package com.kai.prc.consummer;

import com.kai.service.UserService;

import java.io.Serializable;
import java.lang.reflect.Proxy;

/**
 * @author kai
 * @date 2021/3/20 9:22
 * @description:
 */
public class FactoryProxy {
    public static <T> T FactoryUserServiceInstance(Class<T> tClass) {

       return (T) Proxy.newProxyInstance(
                FactoryProxy.class.getClassLoader(),
                new Class[]{tClass, Serializable.class},
               new PRCInvocationHandler());
    }

}
